<%@ page import="java.util.List" %>
<%@ page import="com.fjw.entity.Student" %><%--
  Created by IntelliJ IDEA.
  User: qianfenggz
  Date: 2025/3/6
  Time: 14:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
  <head>
    <title>$Title$</title>
  </head>
  <body>
  <h1 onclick="goAdd()">增加</h1>
    <table border="1px" width="80%" align="center">
      <tr>
        <th>学号</th>
        <th>姓名</th>
        <th>年龄</th>
        <th>描述</th>
        <th>操作</th>
      </tr>
<%--items 表示需遍历的集合--%>
<c:forEach items="${studentList}"  varStatus="sta" var="student">

     <tr>
       <td>${student.sid} ${sta.index}</td>
       <td>${student.sname}</td>
       <td>${student.sage}</td>
       <td>${student.sdesc}</td>
       <td><a href="studentServlet?sid=${student.sid}&flag=goUpdate">修改</a>
        <a href="studentServlet?sid=${student.sid}&flag=delete">删除</a>
       </td>
     </tr>
</c:forEach>


    </table>

  <script>
      function  goAdd(){
          window.location.href="studentServlet?flag=goAdd"
      }
  </script>
  </body>
</html>
